1 /* 2 * Copyright (c) 2011-2014 - Mauro Carvalho Chehab 3 * Copyright (c) 2012 - Andre Roth <neolynx@gmail.com> 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU Lesser General Public License as published by 7 * the Free Software Foundation version 2.1 of the License. 8 * 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU Lesser General Public License for more details. 13 * 14 * You should have received a copy of the GNU Lesser General Public License 15 * along with this program; if not, write to the Free Software 16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 * Or, point your browser to http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 18 * 19 */ 20 21 /** 22 * @file desc_network_name.h 23 * @ingroup descriptors 24 * @brief Provides the descriptors for the network name descriptor 25 * @copyright GNU Lesser General Public License version 2.1 (LGPLv2.1) 26 * @author Mauro Carvalho Chehab 27 * @author Andre Roth 28 * 29 * @par Relevant specs 30 * The descriptor described herein is defined at: 31 * - ETSI EN 300 468 V1.11.1 (2010-04) 32 * 33 * @par Bug Report 34 * Please submit bug reports and patches to linux-media@vger.kernel.org 35 */ 36 37 module libdvbv5_d.desc_network_name; 38 39 import libdvbv5_d.descriptors: dvb_desc; 40 import libdvbv5_d.dvb_fe: dvb_v5_fe_parms; 41 42 extern (C): 43 44 /** 45 * @struct dvb_desc_network_name 46 * @ingroup descriptors 47 * @brief Struct containing the network name descriptor 48 * 49 * @param type descriptor tag 50 * @param length descriptor length 51 * @param next pointer to struct dvb_desc 52 * @param network_name network name string 53 * @param network_name_emph network name emphasis string 54 * 55 * @details 56 * The emphasis text is the one that uses asterisks. For example, in the text: 57 * "the quick *fox* jumps over the lazy table" the emphasis would be "fox". 58 */ 59 struct dvb_desc_network_name 60 { 61 align (1): 62 63 ubyte type; 64 ubyte length; 65 dvb_desc* next; 66 67 char* network_name; 68 char* network_name_emph; 69 } 70 71 // struct dvb_v5_fe_parms; 72 73 /** 74 * @brief Initializes and parses the network name descriptor 75 * @ingroup descriptors 76 * 77 * @param parms struct dvb_v5_fe_parms pointer to the opened device 78 * @param buf buffer containing the descriptor's raw data 79 * @param desc pointer to struct dvb_desc to be allocated and filled 80 * 81 * This function allocates a the descriptor and fills the fields inside 82 * the struct. It also makes sure that all fields will follow the CPU 83 * endianness. Due to that, the content of the buffer may change. 84 * 85 * @return On success, it returns the size of the allocated struct. 86 * A negative value indicates an error. 87 */ 88 int dvb_desc_network_name_init ( 89 dvb_v5_fe_parms* parms, 90 const(ubyte)* buf, 91 dvb_desc* desc); 92 93 /** 94 * @brief Prints the content of the network name descriptor 95 * @ingroup descriptors 96 * 97 * @param parms struct dvb_v5_fe_parms pointer to the opened device 98 * @param desc pointer to struct dvb_desc 99 */ 100 void dvb_desc_network_name_print ( 101 dvb_v5_fe_parms* parms, 102 const(dvb_desc)* desc); 103 104 /** 105 * @brief Frees all data allocated by the network name descriptor 106 * @ingroup descriptors 107 * 108 * @param desc pointer to struct dvb_desc to be freed 109 */ 110 void dvb_desc_network_name_free (dvb_desc* desc);